
cmake_minimum_required(VERSION 3.11)

project(cmake_demo VERSION 1.0.0 LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(CMAKE_AUTOMOC ON)
# set(CMAKE_AUTORCC ON)
# set(CMAKE_AUTOUIC ON)

if(CMAKE_VERSION VERSION_LESS "3.7.0")
    set(CMAKE_INCLUDE_CURRENT_DIR ON)
endif()

# find_package(Qt5Core)
find_package(Qt5 COMPONENTS Core REQUIRED)

add_executable(${PROJECT_NAME} "main.cpp" "myobject.cpp")

target_link_libraries(${PROJECT_NAME} Qt5::Core)



# referred from official web document:
# https://doc.qt.io/qt-5/cmake-get-started.html

# cmake_minimum_required(VERSION 3.1.0)

# project(helloworld VERSION 1.0.0 LANGUAGES CXX)

# set(CMAKE_CXX_STANDARD 11)
# set(CMAKE_CXX_STANDARD_REQUIRED ON)

# set(CMAKE_AUTOMOC ON)
# set(CMAKE_AUTORCC ON)
# set(CMAKE_AUTOUIC ON)

# if(CMAKE_VERSION VERSION_LESS "3.7.0")
#     set(CMAKE_INCLUDE_CURRENT_DIR ON)
# endif()

# find_package(Qt5 COMPONENTS Widgets REQUIRED)

# add_executable(helloworld
#     mainwindow.ui
#     mainwindow.cpp
#     main.cpp
#     resources.qrc
# )

# target_link_libraries(helloworld Qt5::Widgets)
